<?
/**
 * FullSearchProjects for Core
 * Version 2.0
 */
class FullSearchProjects 

{
	public $projects = array();
	
	function __construct($dialog, $search_db = 'search') {
		$this->dialog = $dialog;
		$this->search_db = $search_db;
	}
	
	function getProjects() {
		
		$full_search_manager = new FullTextSearchManager();		
		$arr = $full_search_manager->getProject($this->search_db);
		
		foreach ($arr as &$item) {
			$this->projects[$item['project_id']] = $item;
		}
		foreach ($this->projects as &$project) {			
			$project['sections'] = array();
			$arr = $full_search_manager->getProjectSection($this->search_db, $project['project_id']);
			foreach ($arr as &$item) {
				$project['sections'][$item['section_id']] = $item;
			}
		}
	}
	
}
?>